/**
 * 
 */
validate=true;
	rgemail=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
	rgphone=/^([0-9]{11})+$/;
	rgpassword=/^([a-zA-Z]{1})([a-zA-Z0-9]{8,18})+$/;
function checkRg(inputt,regex,error)
{
	if(regex.test(inputt.val()))
	{
		$(inputt).next("label").html("");
		return true;
	}
	else 
	{	
		
		$(inputt).next("label").html(error).css("color","#ff0000");
		return false;
	}
}
function check(inputt,min,max,error)
{
	
		if(inputt.val().length<min||inputt.val().length>max)
		{
			$(inputt).next("label").html(error+min+"-"+max+"位").css("color","#ff0000");
			return false;
		}
		else
			{
			$(inputt).next("label").html("");
			return true;
			}
}

function vali()
{
	validate=true;
	validate=validate&&check($("input[name=company]"),"6","20","公司名长度");
	validate=validate&&check($("input[name=linkman]"),"3","5","联系人长度");
	validate=validate&&checkRg($("input[name=email]"),rgemail,"邮箱格式,xxxx@163.com");
	validate=validate&&checkRg($("input[name=phone]"),rgphone,"手机号码格式15154127896");
	validate=validate&&check($("input[name=address]"),"5","20","地址长度");
	validate=validate&&check($("input[name=username]"),"3","10","用户名长度");
	validate=validate&&checkRg($("input[name=password]"),rgpassword,"密码格式不对");

	return validate;
}
